Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #692 +/- ##
==========================================
- Coverage 94.14% 94.12% -0.03%
==========================================
Files 14 14
Lines 5741 5749 +8
Branches 458 458
==========================================
+ Hits 5405 5411 +6
- Misses 335 337 +2
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 3.45%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing |
| ("p;s/x//", "x", "x\n"), | ||
| ("s/x//;p", "a\nx", "a\na\n\n"), | ||
| ("s/x//", "x", ""), | ||
| ("$!d;s/x//", "a\nx", ""), |
There was a problem hiding this comment.
could you please add cases for q and c/D too? e.g. s/x//;q and $!N;D on an empty unterminated last line, since they go through the new path as well
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ef09359 to
90f2a2e
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
When the last line lacks its newline and the pattern space is empty, printing it should still separate the output into lines, as GNU sed does:
OutputBuffer::write_chunkreturned early for an empty chunk without a newline, so the line neither ended the previous output's line nor made the next output start a new one. The early return was also how a deleted cycle (d,c,D) avoided the auto-print, since those leave a cleared pattern space of the same shape. Soc,dandDnow set adeletedflag that skips the auto-print, andwrite_chunktreats an empty unterminated chunk as a line: it writes any pending newline and leaves its own pending.The new test covers the cases above, plus empty output that must stay empty (
s/x//onx, and$!d;s/x//). It fails onmain. The other integration tests are unchanged. On my Windows checkout, the same 48 fail onmainand on this branch. I also re-ran a few hundred scripts comparing against GNU sed 4.9 with no new differences.AI disclosure: written with help from Claude Code.
🤖 Generated with Claude Code